<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
</head>
<body>
    <script>
        //返回满足条件的那个值
        var arr=[1,5,3];
        var value=arr.find(item=>item==5);
        console.log(value)   //5
        // var arr=[{id:001,content:"vue"},{id:002,content:"react"},{id:003,content:"html"}]
        // /* 获取id=002的下标 */
        // var index=arr.findIndex(item=>item.id==002)
        // console.log(index)

    </script>
</body>
</html>